function loadDevilCave() {
    $('#mainContent').html(template('t_devilCave'))
    var devilCaveIndex = player.basicInfo.devilCaveIndex
    var config = templateConfig.devilCave[330001].monsters
    var num = config.length
    var monsterId = config[devilCaveIndex]
    var monster = templateConfig.monster[monsterId]
    loadAdventureInfo()
    console.log(devilCaveIndex + '_' + num)
    if (devilCaveIndex === num - 1) {
        $('.floor').html('BOSS')
          $('.monsterName').html(monster.name)
          $('.attackDevilCave span').attr('class', 'icon-' + monster.picId)
    } else if (devilCaveIndex < num - 1) {
        $('.floor').html(devilCaveIndex + 1 + '层')
        $('.monsterName').html(monster.name)
        $('.attackDevilCave span').attr('class', 'icon-' + monster.picId)
    } else {

    }
    $('.attackDevilCave').click(function() {
        request.attackDevilCave(function(res) {
            attacks(res.fightMsg)
            if (res.fightMsg.result === 1) {
                showMessage('你击杀了' + res.fightMsg.p2.name)
                loadDevilCave()
            } else {
                showMessage('你阵亡了')
                loadSecretGuard()
            }
        })
    })

    $('.exitDevilCave').click(function() {
        request.exitDevilCave(function(res) {
            loadSecretGuard()
        })
    })
}
